package org.hbhk.aili.job.event;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

public class HttpJobConfig implements RowMapper<HttpJobConfig> {

	String name;
	String cron;
	String param;

	String address;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCron() {
		return cron;
	}

	public void setCron(String cron) {
		this.cron = cron;
	}


	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		this.param = param;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public HttpJobConfig mapRow(ResultSet rs, int rowNum) throws SQLException {

		HttpJobConfig jobRpc = new HttpJobConfig();
		// job_name ,cron ,rpc_service,param,address
		jobRpc.setName(rs.getString("job_name"));
		jobRpc.setCron(rs.getString("cron"));
		jobRpc.setParam(rs.getString("param"));
		jobRpc.setAddress(rs.getString("url"));

		return jobRpc;
	}

}
